# Serene Programming Language
#
# Copyright (c) 2019-2024 Sameer Rahmani <lxsameer@gnu.org>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, version 2.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program.  If not, see <http://www.gnu.org/licenses/>.

if(SERENE_BUILD_TESTING)
  include(GoogleTest)




  add_executable(serene_test
    reader_tests.cpp
  )

  target_link_libraries(serene_test PRIVATE
    GTest::gtest_main
    LLVMSupport)

  target_include_directories(serene_test
    SYSTEM PRIVATE
    ${CMAKE_CURRENT_SOURCE_DIR}/../include
    ${CMAKE_CURRENT_SOURCE_DIR}/../src
  )

  target_include_directories(serene_test SYSTEM PUBLIC
    # We don't want the generated files from table gen
    # to be treated as local since the contain warnings
    ${PROJECT_BINARY_DIR}/serene/include)

  gtest_discover_tests(serene_test)
endif()
